#include "light.h"

Light::Light(){
	position = Vector3D(5.0, -10.0, 10.0);

    material = Material(0.1, 0.8, 0.3);

	global[0] = 0.5;
	global[1] = 0.5;
	global[2] = 0.5;
}

Light::Light(const Vector3D &_pos, const Material &_m, double _r, double _g, double _b) : position(_pos), material(_m){
	global[0] = _r;
	global[1] = _g;
	global[2] = _b;
}

Light::~Light(){
}


void Light::setGlobal(double _globalR, double _globalG, double _globalB){
	global[0] = _globalR;
	global[1] = _globalG;
	global[2] = _globalB;
}

const double* Light::getGlobal() const{
	return global;
}

const GLfloat* Light::getGlobalGL() const{
    GLfloat *result = new GLfloat[3];
    for(int i = 0; i < 3; i++){
        result[i] = (GLfloat)global[i];
    }
	return result;
}

